<!-- bi-mine-menu-item.vue -->
<template>
  <view class="bi-mine-menu-item" @click="handleClick">
    <image :src="icon" class="bi-mine-menu-item__icon"></image>
    <text class="bi-mine-menu-item__title">{{ title }}</text>
    <text v-if="desc" class="bi-mine-menu-item__desc">{{ desc }}</text>
  </view>
</template>

<script>
export default {
  props: {
    icon: { type: String, required: true },
    title: { type: String, required: true },
    desc: { type: String, default: null },
  },
  methods: {
    handleClick() {
      this.$emit('click');
    }
  }
};
</script>

<style lang="less">
.bi-mine-menu-item {
  display: flex;
  align-items: center;
  background-color: #fff;
  margin: 10rpx 0;
  border-radius: 20rpx;
  padding: 20rpx 30rpx;
  height: 70rpx;
  font-size: 30rpx;
  font-weight: bold;
  color: #333;

  &__icon {
    width: 45rpx;
    height: 45rpx;
    margin-right: 30rpx;
  }

  &__title {
    flex: 1;
  }

  &__desc {
    color: #f47554;
    font-size: 26rpx;
    margin-left: 20rpx;
  }
}
</style>
